<?php
$mysql_user = 'root'; //数据库用户名
$mysql_pass = '123456'; //数据库密码
$mysql_name = 'xy3';//数据库名称
$conn = @mysql_connect("localhost",$mysql_user,$mysql_pass);
//后台数据库配置

if (!$conn){
    die("连接数据库失败：" . mysql_error());
}
mysql_select_db("xy3", $conn); 
//字符转换，读库
mysql_query("set character set 'gbk'");
//写库
mysql_query("set names utf8");

//monogodb数据库配置
$mongodbname='root';
$mongodbpass='812xyxylz63864lz';
$m = new MongoClient("mongodb://${mongodbname}:${mongodbpass}@127.0.0.1");
$db = $m -> gamelogic;

//Redis数据库配置


$redis=array();
$redis[1] = new Redis();
$redis[1]->connect('127.0.0.1', 6379,30); 
$redis[1]->auth('123456'); //密码
$redis[1]->select(1);
/*
$redis[2] = new Redis();
$redis[2]->connect('127.0.0.1', 6999,30); 
$redis[2]->auth('123456'); //密码
$redis[2]->select(1);
*/

?>